using System;
using System.Data;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ACME.Northwind.DataTransfer;
using ACME.Northwind.Service.Interfaces;
using ACME.Northwind.MockProxy.EventArgs;

namespace ACME.Northwind.MockProxy
{
	/// <summary>
	/// The service implementation for CustomerCustomerDemo object
	/// </summary>
	public partial class CustomerCustomerDemoService : ICustomerCustomerDemoService
	{
		#region ICustomerCustomerDemoService Members

		/// <summary>
		/// Run the mock for the select by the primary key
		/// </summary>
		public CustomerCustomerDemoDTO SelectByPrimaryKey(string customerid, string customertypeid)
		{
			CustomerCustomerDemoPrimaryKeyEventArgs eventArgs = new CustomerCustomerDemoPrimaryKeyEventArgs(customerid, customertypeid);
			this.OnMockCustomerCustomerDemoSelectByPrimaryKey(eventArgs);
			return eventArgs.ReturnValue;
		}

		/// <summary>
		/// Run the mock for select all
		/// </summary>
		public List<CustomerCustomerDemoDTO> RunSelect()
		{
			CustomerCustomerDemoRunSelectEventArgs eventArgs = new CustomerCustomerDemoRunSelectEventArgs();
			this.OnMockCustomerCustomerDemoRunSelect(eventArgs);
			return eventArgs.ReturnValue;
		}

		/// <summary>
		/// Run the mock for select with LINQ
		/// </summary>
		public List<CustomerCustomerDemoDTO> RunSelect(string linq)
		{
			CustomerCustomerDemoRunSelectLINQEventArgs eventArgs = new CustomerCustomerDemoRunSelectLINQEventArgs(linq);
			this.OnMockCustomerCustomerDemoRunSelectLINQ(eventArgs);
			return eventArgs.ReturnValue;
		}

		/// <summary>
		/// Run the mock for paged select
		/// </summary>
		public PagedQueryResults<CustomerCustomerDemoDTO> RunSelect(int pageIndex, int pageSize, bool ascending, string sortColumn, string linq)
		{
			CustomerCustomerDemoRunSelectPagedEventArgs eventArgs = new CustomerCustomerDemoRunSelectPagedEventArgs(pageIndex, pageSize, ascending, sortColumn, linq);
			this.OnMockCustomerCustomerDemoRunSelectPaged(eventArgs);
			return eventArgs.ReturnValue;
		}

		/// <summary>
		/// Return the related CustomerDemographic item
		/// </summary>
		public CustomerDemographicDTO GetCustomerDemographicItem(CustomerCustomerDemoDTO item)
		{
			CustomerDemographicDTO retval = new CustomerDemographicDTO();
			CustomerCustomerDemoDTOEventArgs eventArgs = new CustomerCustomerDemoDTOEventArgs(item);
			this.OnMockGetCustomerDemographicItem(eventArgs);
			retval = (CustomerDemographicDTO)eventArgs.ReturnDTOItem;
			return retval;
		}

		/// <summary>
		/// Return the related Customer item
		/// </summary>
		public CustomerDTO GetCustomerItem(CustomerCustomerDemoDTO item)
		{
			CustomerDTO retval = new CustomerDTO();
			CustomerCustomerDemoDTOEventArgs eventArgs = new CustomerCustomerDemoDTOEventArgs(item);
			this.OnMockGetCustomerItem(eventArgs);
			retval = (CustomerDTO)eventArgs.ReturnDTOItem;
			return retval;
		}

		/// <summary>
		/// Persists a single item
		/// </summary>
		public bool Persist(CustomerCustomerDemoDTO dto)
		{
			CustomerCustomerDemoPersistEventArgs eventArgs = new CustomerCustomerDemoPersistEventArgs(dto);
			this.OnMockCustomerCustomerDemoPersist(eventArgs);
			return eventArgs.ReturnValue;
		}

		/// <summary>
		/// Persists a list
		/// </summary>
		public bool Persist(List<CustomerCustomerDemoDTO> list)
		{
			CustomerCustomerDemoPersistEventArgs eventArgs = new CustomerCustomerDemoPersistEventArgs(list);
			this.OnMockCustomerCustomerDemoPersist(eventArgs);
			return eventArgs.ReturnValue;
		}

		/// <summary>
		/// Delete a single item
		/// </summary>
		public bool Delete(CustomerCustomerDemoDTO dto)
		{
			CustomerCustomerDemoDeleteEventArgs eventArgs = new CustomerCustomerDemoDeleteEventArgs(dto);
			this.OnMockCustomerCustomerDemoDelete(eventArgs);
			return eventArgs.ReturnValue;
		}

		#endregion

		#region CustomerCustomerDemo Events

		partial void GetSelectByPrimaryKey();

		/// <summary>
		/// The event for the SelectByPrimaryKey method
		/// </summary>
		public event EventHandler<CustomerCustomerDemoPrimaryKeyEventArgs> MockCustomerCustomerDemoSelectByPrimaryKey;

		/// <summary>
		/// Raises the OnMockRegistrationCodeSelectByPrimaryKey event
		/// </summary>
		protected virtual void OnMockCustomerCustomerDemoSelectByPrimaryKey(CustomerCustomerDemoPrimaryKeyEventArgs e)
		{
			if (this.MockCustomerCustomerDemoSelectByPrimaryKey != null)
				this.MockCustomerCustomerDemoSelectByPrimaryKey(this, e);
		}

		/// <summary>
		/// The event for the RunSelect method
		/// </summary>
		public event EventHandler<CustomerCustomerDemoRunSelectEventArgs> MockCustomerCustomerDemoRunSelect;

		/// <summary>
		/// Raises the OnMockRunSelect event
		/// </summary>
		protected virtual void OnMockCustomerCustomerDemoRunSelect(CustomerCustomerDemoRunSelectEventArgs e)
		{
			if (this.MockCustomerCustomerDemoRunSelect != null)
				this.MockCustomerCustomerDemoRunSelect(this, e);
		}

		/// <summary>
		/// The event for the RunSelectLINQ method
		/// </summary>
		public event EventHandler<CustomerCustomerDemoRunSelectLINQEventArgs> MockCustomerCustomerDemoRunSelectLINQ;

		/// <summary>
		/// The event for the OnMockRunSelectLINQ method
		/// </summary>
		protected virtual void OnMockCustomerCustomerDemoRunSelectLINQ(CustomerCustomerDemoRunSelectLINQEventArgs e)
		{
			if (this.MockCustomerCustomerDemoRunSelectLINQ != null)
				this.MockCustomerCustomerDemoRunSelectLINQ(this, e);
		}

		/// <summary>
		/// The event for the RunSelectPaged method
		/// </summary>
		public event EventHandler<CustomerCustomerDemoRunSelectPagedEventArgs> MockCustomerCustomerDemoRunSelectPaged;

		/// <summary>
		/// The event for the OnMockRunSelectPaged method
		/// </summary>
		protected virtual void OnMockCustomerCustomerDemoRunSelectPaged(CustomerCustomerDemoRunSelectPagedEventArgs e)
		{
			if (this.MockCustomerCustomerDemoRunSelectPaged != null)
				this.MockCustomerCustomerDemoRunSelectPaged(this, e);
		}

		/// <summary>
		/// The event for the GetCustomerDemographicItem method
		/// </summary>
		public event EventHandler<CustomerCustomerDemoDTOEventArgs> MockGetCustomerDemographicItem;

		/// <summary>
		/// The event for the OnMockGetCustomerDemographicItem method
		/// </summary>
		protected virtual void OnMockGetCustomerDemographicItem(CustomerCustomerDemoDTOEventArgs e)
		{
			if (this.MockGetCustomerDemographicItem != null)
				this.MockGetCustomerDemographicItem(this, e);
		}

		/// <summary>
		/// The event for the GetCustomerItem method
		/// </summary>
		public event EventHandler<CustomerCustomerDemoDTOEventArgs> MockGetCustomerItem;

		/// <summary>
		/// The event for the OnMockGetCustomerItem method
		/// </summary>
		protected virtual void OnMockGetCustomerItem(CustomerCustomerDemoDTOEventArgs e)
		{
			if (this.MockGetCustomerItem != null)
				this.MockGetCustomerItem(this, e);
		}

		/// <summary>
		/// The event for the Persist method
		/// </summary>
		public event EventHandler<CustomerCustomerDemoPersistEventArgs> MockCustomerCustomerDemoPersist;

		/// <summary>
		/// Raises the OnMockPersist event
		/// </summary>
		protected virtual void OnMockCustomerCustomerDemoPersist(CustomerCustomerDemoPersistEventArgs e)
		{
			if (this.MockCustomerCustomerDemoPersist != null)
				this.MockCustomerCustomerDemoPersist(this, e);
		}

		/// <summary>
		/// The event for the Delete method
		/// </summary>
		public event EventHandler<CustomerCustomerDemoDeleteEventArgs> MockCustomerCustomerDemoDelete;

		/// <summary>
		/// Raises the OnMockDelete event
		/// </summary>
		protected virtual void OnMockCustomerCustomerDemoDelete(CustomerCustomerDemoDeleteEventArgs e)
		{
			if (this.MockCustomerCustomerDemoDelete != null)
				this.MockCustomerCustomerDemoDelete(this, e);
		}

		#endregion

	}
}
